home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / WINWORDS / MINFX10B.ZIP / MINIFAX.TXT < prev   
Text File  |  1993-01-11  |  2KB  |  73 lines

  1. 'MasterMind Software offers this quick and dirty version of
  2. 'its Word for Windows Macro: AutoFax
  3. '
  4. 'The full version is available in the MSWORD forum, Word for
  5. 'Windows library, as AUTOFAX!.ZIP
  6. '
  7. 'To use THIS macro, please follow these directions:
  8. '
  9. 'Set up a section of WIN.INI called [AutoFax]
  10. 'It should look like this:
  11. '
  12. '[AutoFax]
  13. 'WinFax Location=E:\PROGS\WINFAX\FAXMNG.EXE
  14. 'WinFax Port=WINFAX ON COM2:
  15. 'Printer Port=IBM LaserPrinter 4019 PS17 ON LPT1:
  16. '
  17. 'This macro will read WIN.INI and check these values.
  18. 'AutoFax will fail if they do not exist.
  19. '
  20. 'Replace "E:\PROGS\WINFAX\FAXMNG.EXE" with the full path and
  21. 'filename of your copy of WINFAX PRO.
  22. 'Replace "WINFAX ON COM2:" with the port name your modem uses
  23. 'Include the colon.
  24. 'Replace "IBM LaserPrinter 4019 PS17 ON LPT1:" with the port to which
  25. 'your actual printer is attached.  Include the colon.
  26. '
  27. 'AutoFax MINI by MasterMind Software -- CompuServe 72630,555
  28. '
  29. '*******************************************************************
  30.  
  31. Sub MAIN
  32. On Error Goto FINISHED
  33.  
  34. WINFAXLOCATION$ = GetProfileString$("AutoFax", "WinFax Location")
  35. WINFAXLOCATION$ = UCase$(WINFAXLOCATION$)
  36. WINFAXPORT$ = GetProfileString$("AutoFax", "WinFax Port")
  37. WINFAXPORT$ = UCase$(WINFAXPORT$)
  38. ORIGINALPORT$ = GetProfileString$("AutoFax", "Printer Port")
  39. ORIGINALPORT$ = UCase$(ORIGINALPORT$)
  40. FAXNUMBER$ = Left$(Selection$(), 14)
  41.  
  42. Dim DLG As UserDialog
  43. Begin Dialog UserDialog  500, 150, "MasterMind -- AutoFax This Document"
  44.     Text 25, 15, 150, 15, "&Recipient Name"
  45.     Text 25, 45, 150, 15, "&Fax Number"
  46.     TextBox 165, 15, 300, 20, .RECIPIENT
  47.     TextBox 165, 40, 150, 20, .FAXNUMBER
  48.     Text 40, 125, 430, 15, "Fax Number Defaults to First 14 Characters of Selection"
  49.     PushButton 80, 80, 150, 25, "&Send"
  50.      CancelButton 280, 80, 150, 25
  51. End Dialog
  52. Redim DLG As UserDialog
  53. DLG.RECIPIENT = RECIPIENT$
  54. DLG.FAXNUMBER = FAXNUMBER$
  55. VAR1 = Dialog(DLG)
  56. RECIPIENT$ = DLG.RECIPIENT
  57. FAXNUMBER$ = DLG.FAXNUMBER
  58. If VAR1 = 0 Then Goto FINISHED
  59.  
  60. FilePrintSetup .Printer = WINFAXPORT$
  61. Shell WINFAXLOCATION$, 0
  62. ChanNumber = DDEInitiate("FAXMNG", "Transmit")
  63. DDEPoke(ChanNumber, "Fax Number", FAXNUMBER$)
  64. DDEPoke(ChanNumber, "Receiver", RECIPIENT$)
  65. DDETerminate(ChanNumber)
  66. Print "Faxing document to " ; RECIPIENT$ ; " at fax number FAXNUMBER$"
  67. FilePrint .Type = 0, .NumCopies = "1", .Range = 0, .PrintToFile = 0, .Collate = 0, .FileName = ""    
  68.  
  69. FINISHED:
  70. FilePrintSetup .Printer = ORIGINALPORT$
  71. End Sub
  72.  
  73.